package org.web.ctrlcv.board.service;

import java.util.HashMap;
import java.util.List;
import org.springframework.stereotype.Service;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.web.ctrlcv.board.dao.BoardDao;

@Service
public class BoardServiceImpl implements BoardService {
	
	@Autowired
	private SqlSession sqlSession;

	@Override
	public List<HashMap<String, Object>> selectBoardList(
			HashMap<String, Object> paramMap) throws Exception {
		// TODO Auto-generated method stub
		BoardDao boardDao = sqlSession.getMapper(BoardDao.class);
		return boardDao.selectBoardList(paramMap);
	}

	@Override
	public HashMap<String, Object> selectBoard(HashMap<String, Object> paramMap)
			throws Exception {
		// TODO Auto-generated method stub
		BoardDao boardDao = sqlSession.getMapper(BoardDao.class);
		return boardDao.selectBoard(paramMap);
	}

	@Override
	public int insertBoard(HashMap<String, String> paramMap) throws Exception {
		// TODO Auto-generated method stub
		BoardDao boardDao = sqlSession.getMapper(BoardDao.class);
		return boardDao.insertBoard(paramMap);
	}

	@Override
	public int updateBoard(HashMap<String, String> paramMap) throws Exception {
		// TODO Auto-generated method stub
		BoardDao boardDao = sqlSession.getMapper(BoardDao.class);
		return boardDao.updateBoard(paramMap);
	}

	@Override
	public int deleteBoard(HashMap<String, String> paramMap) throws Exception {
		// TODO Auto-generated method stub
		BoardDao boardDao = sqlSession.getMapper(BoardDao.class);
		return boardDao.deleteBoard(paramMap);
	}

}
